package cn.net.zidian.mvvm.activity;

import android.view.LayoutInflater;
import android.view.View;

import androidx.recyclerview.widget.LinearLayoutManager;

import cn.net.zidian.databinding.ActivityHistoryBinding;
import cn.net.zidian.mvvm.adapter.HistoryAdapter;
import cn.net.zidian.mvvm.vm.BaseViewModel;
import cn.net.zidian.util.HistoryData;


public class HistoryActivity extends BaseActivity {

    private ActivityHistoryBinding viewBinding;

    private HistoryAdapter adapter = new HistoryAdapter();

    @Override
    protected BaseViewModel viewModel() {
        return null;
    }

    @Override
    protected void initView() {
        viewBinding = ActivityHistoryBinding.inflate(LayoutInflater.from(this));
        setContentView(viewBinding.getRoot());
        viewBinding.titleBar.getLeftView().setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        viewBinding.rvList.setLayoutManager(new LinearLayoutManager(this));
        viewBinding.rvList.setAdapter(adapter);
        adapter.setNewData(HistoryData.list);
    }

}
